#!/usr/bin/env bash

# PACKAGE: Gunther
# VERSION: 2.0
# DATE: 09/30/08
# AUTHOR(S): Zarrar Shehzad


######################
# CONFIGURATION FILE #
######################


# SET OUTPUT FILE TYPE
# (based on FSL)

## Extension for time series files (e.g. global signal)
export gTS_EXT="1D"

## Extension for images
case ${FSLOUTPUTTYPE} in
    "ANALYZE" )
        gOUTPUT_TYPE="img"
        ;;
    "NIFTI" )
        gOUTPUT_TYPE="nii"
        ;;
    "NIFTI_PAIR" )
        gOUTPUT_TYPE="img"
        ;;
    "ANALYZE_GZ" )
        gOUTPUT_TYPE="img.gz"
        ;;
    "NIFTI_GZ" )
        gOUTPUT_TYPE="nii.gz"
        ;;
    "NIFTI_PAIR_GZ" )
        gOUTPUT_TYPE="img.gz"
        ;;
    * )
        echo "$FSLOUTPUTTYPE not recognized"
        exit 1
        ;;
esac
export gOUTPUT_TYPE


#
# DO OTHER THINGS NOW
#

# SPECIFIC CONFIG FILE
export gSubConfigFile="$GUNTHERDIR/config/subject.sh"
export gMaskConfigFile="$GUNTHERDIR/config/mask.sh"
export gCreateMaskConfigFile="$GUNTHERDIR/config/createMask.sh"

# LOGGING
export gLOG_FILE="" ## default, no logging
export gLOG_LEVEL=3 ## default, save commands+

# SETTINGS
export gTR=2
export gVOLNUM=197
export gFWHM=6

# MISCELLANEOUS gDIRECTORIES
export gDIR_MASKS="/fmri/masks"
export gDIR_PRIORS="/fmri/segment"
export gDIR_LOG="logs"
export gDIR_DESIGN="design"
export gDIR_MAT="mat"
export gDIR_FSF="fsf"


####
# INDIVIDUAL SUBJECT DATA
####

export gDIR_SUBDATA="/fmri2/data"

# RAW DATA
export gDIR_RAW="raw"

# QUALITY CONTROL
export gDIR_CHECKS="0_checks"

# ANATOMICAL DATA
# location: gDIR_DATA/subject/gDIR_ANAT
export gDIR_ANAT="anat"
export gFN_MPRAGEBASE="mprage"
export gFN_MPRAGE="${gFN_MPRAGEBASE}.${gOUTPUT_TYPE}"
export gFN_HEAD="head.${gOUTPUT_TYPE}"
export gFN_BRAINBASE="brain"
export gFN_BRAIN="${gFN_BRAINBASE}.${gOUTPUT_TYPE}"

# STANDARD ANATOMICAL
export gDIR_STANDARDS="${FSLDIR}/data/standard"
export gFN_STANDARD_1="${gDIR_STANDARDS}/MNI152_T1_1mm_brain.nii.gz"
export gFN_STANDARD_2="${gDIR_STANDARDS}/MNI152_T1_2mm_brain.nii.gz"
export gFN_STANDARD="${gFN_STANDARD_2}"

# FUNCTIONAL DATA
# location: /gDIR_PREDATA/subject/gDIR_FUNC
export gDIR_FUNC='func'
export gFN_FUNCBASE="lfo"
export gFN_FUNCRAW="${gFN_FUNCBASE}.${gOUTPUT_TYPE}"
export gFN_FUNCEXAMPLE="${gFN_FUNCBASE}_example.${gOUTPUT_TYPE}"
export gFN_FUNCMASK="${gFN_FUNCBASE}_mask.${gOUTPUT_TYPE}"
export gFN_FUNCPP="${gFN_FUNCBASE}_pp.${gOUTPUT_TYPE}"
export gFN_FUNCRES="${gFN_FUNCBASE}_normres"
export gFN_FUNCRES2STANDARD="${gFN_FUNCBASE}_normres2standard.${gOUTPUT_TYPE}"

# PREPROCESSING (of functional)
# location: /gDIR_PREDATA/subject/gDIR_FUNC/gDIR_PRE
export gDIR_PRE="1_preprocess"

# REGISTRATION
# location: /gDIR_PREDATA/subject/gDIR_FUNC/gDIR_REG
export gDIR_REG="2_reg"

# SEGMENTATION
# location: /gDIR_PREDATA/subject/gDIR_FUNC/gDIR_SEGMENT
export gDIR_SEGMENT="3_segment"
export gDIR_SEGMENTPRIORS="${GUNTHERDIR}/etc/priors"
export gPRIOR_WHITE="${gDIR_SEGMENTPRIORS}/avg152T1_white_bin.nii.gz"
export gPRIOR_CSF="${gDIR_SEGMENTPRIORS}/avg152T1_csf_bin.nii.gz"

# NUISANCE COVARIATE FILES
# location: /gDIR_PREDATA/subject/gDIR_FUNC/gDIR_NUISANCE
export gDIR_NUISANCE="4_nuisance"
export gFN_GLOBAL="global.${gTS_EXT}"
export gFN_CSF="csf.${gTS_EXT}"
export gFN_WM="wm.${gTS_EXT}"
export gFN_GLOBAL_NONGREY="global_nongrey.${gTS_EXT}"
export gFN_MCBASE="mc"
export gFN_MC="${gFN_FUNCBASE}_${gFN_MCBASE}.${gTS_EXT}"

# EXTRACTED TIME SERIES
export gDIR_TS="5_seeds"

# FEATS
export gDIR_FEATS="6_feats"


#####
# GROUP DATA
#####

# GROUP PROCESSED DATA
export gDIR_GROUPDATA="/projects"
